<template>
			  <page-meta :root-font-size="fontSizeStore.currentFontSizeRpx"></page-meta>
  <view class="appointment-page">
    <!-- 导航栏 -->

    <!-- 预约记录列表 -->
    <view class="appointment-list">
      <!-- 循环渲染预约记录 -->
      <view class="appointment-item" v-for="(item, index) in props.list" :key="index">
        <!-- 预约项目和状态 -->
        <view class="item-header">
          <view class="appointment-type text12">{{ item.type }}</view>
          <view class="appointment-status text12" :class="item.status === '已完成' ? 'completed' : 'pending'">
            {{ item.status }}
          </view>
        </view>

        <!-- 预约详情 -->
        <view class="item-details">
          <view class="detail-row">
            <text class="detail-label text11">日期：</text>
            <text class="detail-value text11">{{ item.date }}</text>
          </view>
          <view class="detail-row">
            <text class="detail-label text11">时间：</text>
            <text class="detail-value text11">{{ item.time }}</text>
          </view>
          <view class="detail-row">
            <text class="detail-label text11">医生：</text>
            <text class="detail-value text11">{{ item.doctor }}</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 空状态提示（当没有记录时显示） -->
    <view class="empty-state" v-if="props.list.length === 0">
      <wd-icon name="calendar" size="80rpx" color="#ccc"></wd-icon>
      <text class="empty-text">暂无预约记录</text>
    </view>
  </view>
</template>

<script setup>
import {
		useFontSizeStore
	} from '@/stores/fontSizeStore';
	const fontSizeStore = useFontSizeStore();
	import {
		useRouter
	} from 'uni-mini-router'
	import {
		defineProps
	} from "vue"

	// 路由实例 - 保留原逻辑
	const router = useRouter();
	const props = defineProps(["list"])

</script>

<style scoped>
.appointment-page {
  min-height: 100vh;
  padding: 20rpx;
}

/* 预约记录列表 */
.appointment-list {
  display: flex;
  flex-direction: column;
  gap: 20rpx;
}

/* 单条预约记录项 */
.appointment-item {
  background-color: #fff;
  border-radius: 15rpx;
  padding: 25rpx;
  box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
}

/* 项目和状态行 */
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20rpx;
  padding-bottom: 15rpx;
  border-bottom: 2rpx solid #f5f5f5;
}

/* 预约项目 */
.appointment-type {
  font-size: 34rpx;
  font-weight: 600;
  color: #333;
}

/* 预约状态 */
.appointment-status {
  font-size: 28rpx;
  padding: 5rpx 15rpx;
  border-radius: 20rpx;
}
/* 状态样式区分 */
.completed {
  background-color: #e6f7ef;
  color: #2A9D54;
}
.pending {
  background-color: #fff7e6;
  color: #E6A23C;
}

/* 详情行 */
.item-details {
  padding-top: 10rpx;
}
.detail-row {
  display: flex;
  margin-bottom: 15rpx;
}
.detail-row:last-child {
  margin-bottom: 0;
}

/* 详情标签和值 */
.detail-label {
  font-size: 30rpx;
  color: #666;
  min-width: 120rpx;
}
.detail-value {
  font-size: 30rpx;
  color: #333;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 200rpx;
}
.empty-text {
  font-size: 32rpx;
  color: #999;
  margin-top: 30rpx;
}
</style>